{% extends "base.html" %}

{% block css %}
<link rel="stylesheet" href="/static/css/admin.css" />
{% endblock %}
{% block nav %}
   <div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
      <div class="container">

        <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </a>
        <a class="brand" href="/admin/">Googler Admin</a>
        <div class="nav-collapse">
          <ul class="nav">

            <li class="active"><a href="/admin/">Home</a></li>
            <li><a href="/admin/view_companies">Companies</a></li>
          </ul>
        </div>
      </div>
    </div>
  </div>
{% endblock %}
{% block content %}
<ul>
  {% for company in companies  %}
    <li><h3>{{company.name}}</h3>
    <p><a href="/api/video/{{company.key}}">Api Link</a></p>
      <form class="form-inline" method="GET" action="/admin/update_youtube_org_playlists">
      <input type="hidden" value="{{company.key}}" name="org_key">
      {% if company.user_id %}
        <input class="btn" type="submit" value="DEV ONLY - Trigger Manual Playlist Update">
      {% else %}
         <a class="btn" href="/org_credentials?org_key={{company.key}}">MUST USE INCOGNITO - Setup Outh2 Credentials</a>
      {% endif %}
      </form>
      <a class="btn" href="/admin/manage_organization?org_key={{company.key}}">Add more curators</a>
      <a class="btn" href="/admin/manage_playlist?org_key={{company.key}}">Create Playlist Targeting Groups</a>
    </li>
  {% endfor %}
</ul>
{% endblock %}
